<html>
<title>about about</title>
<script>
var log0;
var links = [
'chrome://global/skin/global.css',
'chrome://global/content/',
'chrome://noscript/content/',
'chrome://noscript/content',
'chrome://noscript/skin/',
'chrome://noscript/skin',
'chrome://noscript/skin/global.css',
];
function log(msg) {
 log0.innerHTML += msg + '\n';
}
function report_error(e, v, l) {
 log('error: ' + e + ', ' + v + ', ' + l);
}
function doit(){
 window.onerror = report_error;
 log0 = document.getElementById("log0");
 log('started');
 alert(navigator.userAgent);
if (navigator.userAgent.indexOf('Opera') > -1) {
   for(var i = 0; i < links.length; ++i) {
		      links[i] = links[i].replace(/about:/, 'opera:');
  }
 }
 for(var i = 0; i < links.length; ++i) {
  jsload(links[i]);
  iframeload(links[i]);
  imgload(links[i]);
  cssload(links[i]);
 } 
}
function jsload(target) {
 var script0 = document.createElement('script');
 script0.type = 'text/javascript';
 script0.async = true;
 script0.onload = function(){log('loaded js: ' + mklink(target))};
 script0.onerror = function(){log('failed js: ' + mklink(target))};
 script0.src = target;
 var node = document.getElementsByTagName('script')[0];
 node.parentNode.insertBefore(script0, node);
}
function iframeload(target) {
 var iframe0 = document.createElement('iframe');
 iframe0.type = 'text/html';
 iframe0.onload = function(){log('loaded iframe: ' + mklink(target))};
 iframe0.onerror = function(){log('failed iframe: ' + mklink(target))};
 iframe0.src = target;
 document.body.appendChild(iframe0);
}
function imgload(target) {
 var img0 = new Image();
 img0.onload = function(){log('loaded img: ' + mklink(target))};
 img0.onerror = function(){log('failed img: ' + mklink(target))};
 img0.src = target;
 document.body.appendChild(img0);
}
function cssload(target) {
 var css0 = document.createElement("link");
 css0.rel = 'stylesheet';
 css0.type = 'text/css';
 css0.onload = function(){log('loaded css: ' + mklink(target))};
 css0.onerror = function(){log('failed css: ' + mklink(target))};
 css0.href = target;
 document.body.appendChild(css0);
// var node = document.getElementsByTagName('script')[0];
// node.parentNode.insertBefore(script0, node);
}
function mklink(l) {
 return ' <a style="color: blue;" href="'+l+'" title="'+l+'">'+l+'</a>';
}
</script>
<body onload="doit()">
<input type="button" onclick="doit()" value="doit">
<div id="log0" style="white-space: pre; font-family: Courier New"></div>
</body>
</html>
